package model

import daos.VillanoDAO
import modelApp.ExpedienteAppModel
import org.uqbar.arena.layout.ColumnLayout
import org.uqbar.arena.layout.HorizontalLayout
import org.uqbar.arena.widgets.Label
import org.uqbar.arena.widgets.Panel
import org.uqbar.arena.windows.WindowOwner
import templates.MapaYVillanoPrincipalTemplate
import templates.MyOwnSimpleWindow

class ExpedienteMisterioView extends MyOwnSimpleWindow<ExpedienteAppModel> {
	
	@Property MapaYVillanoPrincipalTemplate template = new MapaYVillanoPrincipalTemplate
	
	new(WindowOwner parent, VillanoDAO villanos) {
		super(parent,new ExpedienteAppModel(villanos) )
	}
	
	override createContents(Panel mainPanel) {
		
		this.setTitle("Expedientes")
		
		val panelMaster = new Panel(mainPanel).setLayout(new HorizontalLayout)
		val panelIzquierdo = new Panel(panelMaster).setLayout(new ColumnLayout(1))
		val panelDerecho = new Panel(panelMaster).setLayout(new ColumnLayout(1))
	
		template.listadoDeElementos(panelIzquierdo,"Villanos","villanos.villanos","villanoSeleccionado")
	
			
		new Label(panelDerecho) => [
			setText("Nombre: ")
			bindValueToProperty("villanoSeleccionado")
			setWidth(174)
			setHeight(29)
		]
		
		template.datosDe(panelDerecho, "Señas", "Seña", "villanoSeleccionado.senhas")
		template.datosDe(panelDerecho, "Hobbies", "Hobbie", "villanoSeleccionado.hobbies")
		
	
	}
}